home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1996 #14 / Monster Media No. 14 (April 1996) (Monster Media, Inc.).ISO / monster / unzip.doc < prev    next >
Text File  |  1994-02-06  |  19KB  |  396 lines

  1.  
  2. UNZIP(1L)              LOCAL USER COMMANDS              UNZIP(1L)
  3.  
  4. NAME
  5.      unzip - list, test and extract compressed  files  in  a  ZIP
  6.      archive
  7.  
  8. SYNOPSIS
  9.      unzip [-Z] [-cflptuvz[ajnoqsUV$]]  file[.zip]  [file(s) ...]
  10.      [-x xfile(s) ...] [-d exdir]
  11.  
  12. DESCRIPTION
  13.      unzip will list, test, or extract files from a ZIP  archive,
  14.      commonly  found  on  MS-DOS  systems.   The default behavior
  15.      (with no options) is to extract into the  current  directory
  16.      (and  subdirectories  below it) all files from the specified
  17.      ZIP archive.  A  companion  program,  zip(1L),  creates  ZIP
  18.      archives;  both  programs are compatible with PKWARE's PKZIP
  19.      and PKUNZIP for MS-DOS.
  20.  
  21. ARGUMENTS
  22.      file[.zip]
  23.           Path of the ZIP archive(s).  If the file  specification
  24.           is  a  wildcard,  each matching file is processed in an
  25.           order determined by the operating system (or file  sys-
  26.           tem).   Only  the  filename can be a wildcard; the path
  27.           itself cannot.  Wildcard  expressions  are  similar  to
  28.           Unix egrep(1) (regular) expressions and may contain:
  29.  
  30.           *    matches a sequence of 0 or more characters
  31.  
  32.           ?    matches exactly 1 character
  33.  
  34.           [...]
  35.                matches any  single  character  found  inside  the
  36.                brackets;  ranges  are  specified  by  a beginning
  37.                character, a hyphen, and an ending character.   If
  38.                an  exclamation point or a caret (`!' or `^') fol-
  39.                lows the left bracket, then the range  of  charac-
  40.                ters within the brackets is complemented (that is,
  41.                anything except the characters inside the brackets
  42.                is considered a match).
  43.  
  44.           (Be sure to quote any character which  might  otherwise
  45.           be  interpreted  or  modified  by the operating system,
  46.           particularly under Unix and VMS.)  If  no  matches  are
  47.           found,  the  specification  is  assumed to be a literal
  48.           filename; and if that also fails, the  suffix  .zip  is
  49.           appended.  Note that self-extracting ZIP files are sup-
  50.           ported; just specify the .exe suffix  (if  any)  expli-
  51.           citly.
  52.  
  53.      [file(s)]
  54.           An optional list of archive members  to  be  processed.
  55.           Regular  expressions  (wildcards)  may be used to match
  56.           multiple members; see above.  Again, be sure  to  quote
  57.           expressions  that  would otherwise be expanded or modi-
  58.           fied by the operating system.
  59.  
  60.      [-x xfile(s)]
  61.           An optional list of archive members to be excluded from
  62.           processing.   Since wildcard characters match directory
  63.           separators (`/'), this option may be  used  to  exclude
  64.           any  files  which  are in subdirectories.  For example,
  65.           ``unzip foo *.[ch] -x */*'' would extract all C  source
  66.           files  in the main directory, but none in any subdirec-
  67.           tories.  Without the -x option, all C source  files  in
  68.           all directories within the zipfile would be extracted.
  69.  
  70.      [-d exdir]
  71.           An optional directory to which to  extract  files.   By
  72.           default,  all files and subdirectories are recreated in
  73.           the current directory; the -d option allows  extraction
  74.           in an arbitrary directory (always assuming one has per-
  75.           mission to write to the directory).  This  option  need
  76.           not  appear  at the end of the command line; it is also
  77.           accepted immediately after the  zipfile  specification,
  78.           or between the file(s) and the -x option.
  79.  
  80. OPTIONS
  81.      -Z   zipinfo(1) mode.  If the first option  on  the  command
  82.           line  is  -Z,  the  remaining  options  are taken to be
  83.           zipinfo(1) options.  See the  appropriate  manual  page
  84.           for a description of these options.
  85.  
  86.      -c   extract files to stdout/screen (``CRT'').  This  option
  87.           is  similar  to  the  -p option except that the name of
  88.           each file is printed as it is extracted, the -a  option
  89.           is  allowed,  and  ASCII-EBCDIC conversion is automati-
  90.           cally performed if appropriate.
  91.  
  92.      -f   freshen existing files, i.e., extract only those  files
  93.           which  already  exist  on disk and which are newer than
  94.           the disk  copies.   By  default  unzip  queries  before
  95.           overwriting,  but the -o option may be used to suppress
  96.           the queries.
  97.  
  98.      -l   list  archive  files   (short   format).    The   name,
  99.           uncompressed  file  size and modification date and time
  100.           of each specified file is printed,  along  with  totals
  101.           for all files specified.  If a file was archived from a
  102.           single-case file system (for example,  the  MS-DOS  FAT
  103.           file  system)  and  the  -U  option  was not given, the
  104.           filename is converted to lowercase and is prefixed with
  105.           a  caret  (^).   In  addition,  the archive comment and
  106.           individual file comments (if any) are displayed.
  107.  
  108.      -p   extract files to pipe (stdout).  Nothing but  the  file
  109.           data  is  sent  to  stdout,  and  the  files are always
  110.           extracted in binary format, just as they are stored (no
  111.           conversions).
  112.  
  113.      -t   test archive files.  This option extracts  each  speci-
  114.           fied file in memory and compares the CRC (cyclic redun-
  115.           dancy check, an enhanced checksum) of the expanded file
  116.           with the original file's stored CRC value.
  117.  
  118.      -u   update existing files and create new  ones  if  needed.
  119.           This  option  performs  the  same  function  as  the -f
  120.           option, extracting (with query) files which  are  newer
  121.           than  those with the same name on disk, and in addition
  122.           it extracts those files which do not already  exist  on
  123.           disk.
  124.  
  125.      -v   list archive files (verbose format).   In  addition  to
  126.           the information given by the -l option, the compression
  127.           method, compressed size, compression ratio  and  32-bit
  128.           CRC is listed.
  129.  
  130.      -z   display only the archive comment.
  131.  
  132. MODIFIERS
  133.      -a   convert text files.  Ordinarily all files are extracted
  134.           exactly  as they are stored (as ``binary'' files).  The
  135.           -a option causes files identified by zip as text  files
  136.           (those  with  the `t' label in zipinfo listings, rather
  137.           than `b') to be automatically extracted as  such,  con-
  138.           verting  line  endings,  end-of-file characters and the
  139.           character set itself as necessary.  (For example,  Unix
  140.           files  use  line  feeds (LFs) for end-of-line (EOL) and
  141.           have no end-of-file (EOF) marker; Macintoshes use  car-
  142.           riage  returns  (CRs)  for  EOLs; and most PC operating
  143.           systems use CR+LF for EOLs and control-Z for  EOF.   In
  144.           addition, IBM mainframes and the Michigan Terminal Sys-
  145.           tem use EBCDIC rather than the more common ASCII  char-
  146.           acter  set,  and  NT supports Unicode.) Note that zip's
  147.           identification of text files is by  no  means  perfect;
  148.           some  ``text''  files  may  actually be binary and vice
  149.           versa.    unzip   therefore   prints   ``[text]''    or
  150.           ``[binary]''  as  a  visual  check  for  each  file  it
  151.           extracts when using the  -a  option.   The  -aa  option
  152.           forces all files to be extracted as text, regardless of
  153.           the supposed file type.
  154.  
  155.      -j   junk paths.  The archive's directory structure  is  not
  156.           recreated;  all  files  are deposited in the extraction
  157.           directory (by default, the current one).
  158.  
  159.      -n   never overwrite existing  files.   If  a  file  already
  160.           exists,  skip  the  extraction  of  that  file  without
  161.           prompting.  By default unzip queries before  extracting
  162.           any  file  which already exists; the user may choose to
  163.           overwrite only the current file, overwrite  all  files,
  164.           skip extraction of the current file, skip extraction of
  165.           all existing files, or rename the current file.
  166.  
  167.      -o   overwrite existing files without prompting.  This is  a
  168.           dangerous  option,  so  use it with care.  (It is often
  169.           used with -f, however.)
  170.  
  171.      -q   perform operations quietly (-qq = even quieter).  Ordi-
  172.           narily  unzip  prints  the  names  of  the  files  it's
  173.           extracting or testing, the extraction methods, any file
  174.           or zipfile comments which may be stored in the archive,
  175.           and possibly a summary when finished with each archive.
  176.           The  -q[q] options suppress the printing of some or all
  177.           of these messages.
  178.  
  179.      -s   [OS/2, NT,  MS-DOS]  convert  spaces  in  filenames  to
  180.           underscores.   Since  all  PC  operating  systems allow
  181.           spaces  in  filenames,  unzip   by   default   extracts
  182.           filenames  with  spaces intact (e.g., ``EA DATA. SF'').
  183.           This can be awkward, however, since MS-DOS in  particu-
  184.           lar  does  not  gracefully support spaces in filenames.
  185.           Conversion of spaces to underscores can  eliminate  the
  186.           awkwardness in some cases.
  187.  
  188.      -U   leave filenames uppercase if created under MS-DOS, VMS,
  189.           etc.   Depending  on the archiver, files archived under
  190.           single-case filesystems may be stored as  all-uppercase
  191.           names;  this  can be awkward when extracting to a case-
  192.           preserving filesystem such as  OS/2  HPFS  or  a  case-
  193.           sensitive  one  such  as  under Unix.  By default unzip
  194.           converts  such  filenames  to  lowercase;  this  option
  195.           causes all filenames to be extracted exactly as they're
  196.           stored (excepting truncation, conversion of unsupported
  197.           characters, etc.).
  198.  
  199.      -V   retain (VMS) file version numbers.  VMS  files  can  be
  200.           stored   with   a   version   number,   in  the  format
  201.           file.ext;##.  By default the  ``;##''  version  numbers
  202.           are  stripped,  but  this  option  allows  them  to  be
  203.           retained.  (On filesystems  which  limit  filenames  to
  204.           particularly  short lengths, the version numbers may be
  205.           truncated or stripped regardless of this option.)
  206.  
  207.      -X   [VMS] restore owner/protection info (may require system
  208.           privileges).    Ordinary  file  attributes  are  always
  209.           restored, but this option allows UICs to be restored as
  210.           well.   [The  next  version  of unzip will support Unix
  211.           UID/GID info as well, and possibly NT permissions.]
  212.  
  213.      -$   [MS-DOS, OS/2, NT, Amiga] restore the volume  label  if
  214.           the  extraction medium is removable (e.g., a diskette).
  215.           Doubling the option  (-$$)  allows  fixed  media  (hard
  216.           disks)  to  be  labelled  as  well.  By default, volume
  217.           labels are ignored.
  218.  
  219. ENVIRONMENT OPTIONS
  220.      unzip's default behavior may be modified via options  placed
  221.      in  an  environment  variable.   This  can  be done with any
  222.      option, but it is probably most useful with the -q, -a,  -o,
  223.      or  -n  modifiers:   make  unzip quieter by default, make it
  224.      auto-convert text files, or  make  it  always  overwrite  or
  225.      never  overwrite files as it extracts them.  For example, to
  226.      make unzip  act  as  quietly  as  possible,  only  reporting
  227.      errors, one would use one of the following commands:
  228.  
  229.         UNZIP=-qq; export UNZIP   Unix Bourne shell
  230.         setenv UNZIP -qq          Unix C shell
  231.         set UNZIP=-qq             OS/2 or MS-DOS
  232.         define UNZIP_OPTS "-qq"   VMS (quotes for lowercase)
  233.  
  234.      Environment options are, in effect, considered  to  be  just
  235.      like  any  other  command-line options, except that they are
  236.      effectively the first options on the command line.  To over-
  237.      ride  an  environment option, one may use the ``minus opera-
  238.      tor'' to remove it.  For instance, to override  one  of  the
  239.      quiet-flags in the example above, use the command
  240.  
  241.         unzip --q[other options] zipfile
  242.  
  243.      The first hyphen is the normal  switch  character,  and  the
  244.      second  is  a  minus sign, acting on the q option.  Thus the
  245.      effect here is to cancel one quantum of quietness.  To  can-
  246.      cel both quiet flags, two (or more) minuses may be used:
  247.  
  248.         unzip -t--q zipfile
  249.         unzip ---qt zipfile
  250.  
  251.      (the two are equivalent).  This may seem awkward or  confus-
  252.      ing,  but it is reasonably intuitive:  just ignore the first
  253.      hyphen and go from there.  It is also  consistent  with  the
  254.      behavior of Unix nice(1).
  255.  
  256. EXAMPLES
  257.      To  use  unzip  to  extract  all  members  of  the   archive
  258.      letters.zip  into  the  current directory and subdirectories
  259.      below it, creating any subdirectories as necessary:
  260.  
  261.         unzip letters
  262.  
  263.      To extract all  members  of  letters.zip  into  the  current
  264.      directory only:
  265.  
  266.         unzip -j letters
  267.  
  268.      To test letters.zip, printing only a summary  message  indi-
  269.      cating whether the archive is OK or not:
  270.  
  271.         unzip -tq letters
  272.  
  273.      To extract to standard output  all  members  of  letters.zip
  274.      whose  names  end in .tex, auto-converting to the local end-
  275.      of-line convention and piping the output into more(1):
  276.  
  277.         unzip -ca letters \*.tex | more
  278.  
  279.      (The backslash before the asterisk is only required  if  the
  280.      shell  expands  wildcards,  as  in Unix; double quotes could
  281.      have been used instead, as in the source example below.)  To
  282.      extract  the  binary  file paper1.dvi to standard output and
  283.      pipe it to a printing program:
  284.  
  285.         unzip -p articles paper1.dvi | dvips
  286.  
  287.      To extract all FORTRAN and C source  files--*.f,  *.c,  *.h,
  288.      and Makefile--into the /tmp directory:
  289.  
  290.         unzip source.zip "*.[fch]" Makefile -d /tmp
  291.  
  292.      (the double quotes are necessary only in Unix  and  only  if
  293.      globbing  is  turned on).  To extract only newer versions of
  294.      the files already in the current directory, without querying
  295.      (NOTE:   be  careful  of unzipping in one timezone a zipfile
  296.      created in another--ZIP archives to date contain no timezone
  297.      information,  and  a ``newer'' file from an eastern timezone
  298.      may, in fact, be older):
  299.  
  300.         unzip -fo sources
  301.  
  302.      To extract newer  versions  of  the  files  already  in  the
  303.      current  directory and to create any files not already there
  304.      (same caveat as previous example):
  305.  
  306.         unzip -uo sources
  307.  
  308.      In the last five examples, assume that UNZIP  or  UNZIP_OPTS
  309.      is set to -q.  To do a singly quiet listing:
  310.  
  311.         unzip -l file
  312.  
  313.      To do a doubly quiet listing:
  314.  
  315.         unzip -ql file
  316.  
  317.      To do a standard listing:
  318.  
  319.         unzip --ql file
  320.      or
  321.         unzip -l-q file
  322.      or
  323.         unzip -l--q file          (extra minuses don't hurt)
  324.  
  325. TIPS
  326.      The current maintainer, being a lazy  sort,  finds  it  very
  327.      useful  to  define  a pair of aliases:  tt for ``unzip -tq''
  328.      and ii for ``unzip -Z'' (or ``zipinfo'').  One may then sim-
  329.      ply  type ``tt zipfile'' to test an archive, something which
  330.      is worth making a habit of  doing.   With  luck  unzip  will
  331.      report  ``No  errors  detected in zipfile.zip,'' after which
  332.      one may breathe a sigh of relief.
  333.  
  334. BUGS
  335.      [MS-DOS] When extracting or testing files from an archive on
  336.      a  defective  floppy  diskette,  if  the  ``Fail'' option is
  337.      chosen from DOS's ``Abort, Retry, Fail?'' message, unzip may
  338.      hang   the  system,  requiring  a  reboot.   Instead,  press
  339.      control-C (or control-Break) to terminate unzip.
  340.  
  341.      Under DEC Ultrix, unzip will sometimes fail on long zipfiles
  342.      (bad  CRC, not always reproducible).  This is apparently due
  343.      either to a hardware bug (cache memory) or an operating sys-
  344.      tem bug (improper handling of page faults?).
  345.  
  346.      Dates and times of stored directories are not restored.
  347.  
  348.      [OS/2] Extended  attributes  for  existing  directories  are
  349.      never  updated.   This is a limitation of the operating sys-
  350.      tem; unzip has no way to determine whether the stored attri-
  351.      butes are newer or older than the existing ones.
  352.  
  353.      [VMS] When extracting to another directory, only the  [.foo]
  354.      syntax  is  accepted  for the -d option; the simple Unix foo
  355.      syntax is silently  ignored  (as  is  the  less  common  VMS
  356.      foo.dir syntax).
  357.  
  358.      [VMS] When the file being extracted already exists,  unzip's
  359.      query  only  allows skipping, overwriting or renaming; there
  360.      should additionally be a choice for creating a  new  version
  361.      of  the file.  In fact, the ``overwrite'' choice does create
  362.      a new  version;  the  old  version  is  not  overwritten  or
  363.      deleted.
  364.  
  365. SEE ALSO
  366.      funzip(1L), zip(1L), zipcloak(1L), zipgrep(1L), zipinfo(1L),
  367.      zipnote(1L), zipsplit(1L)
  368.  
  369. AUTHORS
  370.      The primary Info-ZIP authors  (current  zip-bugs  workgroup)
  371.      are:   Jean-loup Gailly (Zip), Greg R. Roelofs (UnZip), Mark
  372.      Adler (decompression, fUnZip), Kai Uwe Rommel  (OS/2),  Igor
  373.      Mandrichenko  (VMS),  John  Bush  and  Paul Kienitz (Amiga),
  374.      Antoine Verheijen (Macintosh), Chris Herborth (Atari), Henry
  375.      Gessau  (NT), and Robert Heath (Windows).  The author of the
  376.      original unzip code  upon  which  Info-ZIP's  is  based  was
  377.      Samuel  H.  Smith; Carl Mascott did the first Unix port; and
  378.      David P. Kirschbaum organized and led Info-ZIP in its  early
  379.      days.   The  full  list  of  contributors to UnZip has grown
  380.      quite large; please refer to the CONTRIBS file in the  UnZip
  381.      source distribution for a more complete list.
  382.  
  383. VERSIONS
  384.      v1.2  15 Mar 89  Samuel H. Smith
  385.      v2.0   9 Sep 89  Samuel H. Smith
  386.      v2.x  fall 1989  many Usenet contributors
  387.      v3.0   1 May 90  Info-ZIP (DPK, consolidator)
  388.      v3.1  15 Aug 90  Info-ZIP (DPK, consolidator)
  389.      v4.0   1 Dec 90  Info-ZIP (GRR, maintainer)
  390.      v4.1  12 May 91  Info-ZIP
  391.      v4.2  20 Mar 92  Info-ZIP (zip-bugs subgroup; GRR, maint.)
  392.      v5.0  21 Aug 92  Info-ZIP (zip-bugs subgroup; GRR, maint.)
  393.      v5.1   7 Feb 94  Info-ZIP (zip-bugs subgroup; GRR, maint.)
  394.  
  395. Info-ZIP             Last change:  7 Feb 94                  v5.1
  396.